# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-pontos
_pkgname=pontos
pkgver=23.11.4
pkgrel=1
pkgdesc="Common utilities and tools maintained by Greenbone Networks"
url="https://github.com/greenbone/pontos/"
arch="noarch"
license="Apache-2.0"
depends="
	py3-colorful
	py3-dateutil
	py3-h2
	py3-httpx
	py3-packaging
	py3-rich
	py3-semver
	py3-tomlkit
	python3
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-poetry-core
	"
checkdepends="
	py3-pytest
	py3-pytest-httpx
	py3-lxml
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/pontos/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl

	# don't access gitconfigs
	touch "$srcdir"/x-git-config
	GIT_CONFIG_GLOBAL="$srcdir"/x-git-config \
		.testenv/bin/python3 -m pytest -k 'not test_git_error'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
ab7331bd8cca759c89d340405f59b5a41b540f8d72e0a72774a3796e2ae2029ac3ee6585954780d60a17233ff282c68b3f9aa0dd47d2b0d51b56cc158e7e39d7  py3-pontos-23.11.4.tar.gz
"
